<?php

class UserRoleType extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Organizations the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'user_role_type';
	}
	
	public function rules()
	{
		return array(
			array('user_role_type_ID, user_role_type_name', 'required'),
		);
	}
	public function relations()
	{
		return array(
			'roletype' => array(self::HAS_MANY, 'Users', 'user_role_type_ID'),
		);
	}
	
	public function loadRoleTypes()
	{
		$res=array();
		$records=$this->findAll();
		foreach($records as $roleType)
		{
			$res[$roleType->user_role_type_ID]=$roleType->user_role_type_name;
		}
		return $res;
	}
}
?>